package com.broada.apm.model;


public class MetricsItem {

	public static enum UNIT {
		NUM, PCT, STR, BYTES, MS
	}

	public final static int OPERATOR_SUM = 1;
	public final static int OPERATOR_AVG = 2;
	public final static int EXTS_TYPE_GROUP_MMA = 1;// max、min、avg分组

	public final static int EXTS_TYPE_ELEMENT = 3;

	private long id;
	private int protocol;
	private String name;
	private String code;
	private UNIT unit;
	private int calculateType;
	private int mode;
	private int extsType;
	private String no;
	private MetricsItem[] exts;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public int getProtocol() {
		return protocol;
	}

	public void setProtocol(int protocol) {
		this.protocol = protocol;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public UNIT getUnit() {
		return unit;
	}

	public void setUnit(int unit) {
		switch (unit) {
		case 1:
			this.unit = UNIT.NUM;
			break;
		case 2:
			this.unit = UNIT.PCT;
			break;
		case 3:
			this.unit = UNIT.STR;
			break;
		case 4:
			this.unit = UNIT.BYTES;
			break;
		case 5:
			this.unit = UNIT.MS;
			break;
		default:
			break;
		}
	}

	public int getCalculateType() {
		return calculateType;
	}

	public void setCalculateType(int calculateType) {
		this.calculateType = calculateType;
	}

	public int getMode() {
		return mode;
	}

	public void setMode(int mode) {
		this.mode = mode;
	}

	public int getExtsType() {
		return extsType;
	}

	public void setExtsType(int extsType) {
		this.extsType = extsType;
	}

	public MetricsItem[] getExts() {
		return exts;
	}

	public void setExts(MetricsItem[] exts) {
		this.exts = exts;
	}

	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}


}
